package com.example.demo.behavior.iterator;

/**
 * @Desc:
 * @Author zzz
 * @Date 2021/2/27
 * @Version V1.0
 */
public class IteratorTest {

    public static void main(String[] args) {
        MyQueue queue = new MyQueue();
        queue.add("aaa");
        queue.add("bbb");
        queue.add("ccc");

        Iterator iterator = queue.iterator();
        System.out.println(iterator.first());
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
